STEP 5: Our current code generates a random number between 1 and 10, but we only want 4 random answers! We also need to rename the variable storing the random integer to clearly describe the value it is storing.

  • Change the second integer argument in .randint() from 10 to 4 to change the range for this command.
  • Rename the variable storing the random number from my_var to rand_answer.
  • Change the variable argument in .Display() from my_var to rand_answer.

To navigate the page using the TAB key, first press ESC to exit the code editor.

# THIS ACTIVITY IS IN PREVIEW ONLY MODE
  • Run Code
  • Submit Work
  • Next Activity
  • Show Console
  • Reset Code Editor
  • Codesters How To (opens in a new tab)